package com.song.guli.service.edu.fegin;

import com.song.guli.common.base.result.R;
import com.song.guli.service.edu.fegin.fallback.OssFileServiceFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 宋超
 * HP - the login name of the current user.
 * 2021/4/4 - the current system date.
 * 21:01 - the current system time.
 */
@Service
//告诉调用是哪个远程微服务(这里是service-oss)  fallback 当远程调用微服务的方法出问题了 兜底的方法为那一个(这里是找OssFileServiceFallBack中定义的兜底方法)
@FeignClient(value = "service-oss",fallback = OssFileServiceFallBack.class)
public interface OssFileService {

    @GetMapping("/admin/oss/file/test")
    R test();

    @DeleteMapping("/admin/oss/file/remove")
    R removeFile(@RequestBody String url);
}
